module.exports= function () {
    return function (err,req,res,next) {
        if(err){
            res.writeHead(500);
            res.end('<h1>Oh no! We have an error!</h1>\n<pre>'+err.stack+'</pre>');
        }else{
            next();
        }
    }
};